﻿using IntelligentAgriculture.Contracts.Interface;
using IntelligentAgriculture.WebAPI.Application.Command.StartCommand;
using MediatR;

namespace IntelligentAgriculture.WebAPI.Application.CommandHandler.StartCommandHandler
{
    /// <summary>
    /// 期初批量删除CommandHandler
    /// </summary>
    public class StartDeleteRangeCommandHandler : IRequestHandler<StartDeleteRangeCommand, Results<int>>
    {

        private readonly IStartService _startService;
        public StartDeleteRangeCommandHandler(IStartService startService)
        {
            _startService = startService;
        }



        public async Task<Results<int>> Handle(StartDeleteRangeCommand request, CancellationToken cancellationToken)
        {
             var list= await _startService.DeleteRangeStart(request.StartIds);
            return Results<int>.DataResult(list);
        }
    }
}
